package com.woniu.airent.mapper;

import com.woniu.airent.dto.HouseDto;
import com.woniu.airent.entity.House;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Repository
public interface HouseMapper {
    int deleteByPrimaryKey(Integer houseId);

    int insert(HouseDto record);

    House selectByPrimaryKey(Integer houseId);

    List<House> selectAll();

    int updateByPrimaryKey(HouseDto record);


    int MyInsert(HouseDto house);

    @Select("select * from t_house where user_id = #{value}")
    List<HouseDto> selectMyHouseByUserId(Integer userId);

    List<HouseDto> selectSorted(@Param("sortMethod") Integer sortMethod);

    HouseDto selectByKey(Integer houseId);

    @Update("update t_house set examine=0 where house_number=#{houseNumber}")
    Integer updateHouseType(@Param("houseNumber") String houseNumber);
}
